libxl: autogenerate to_string and from_string functions for Enumerations.
authorIan Campbell <ian.campbell@citrix.com>
Tue, 21 Jun 2011 17:26:39 +0000 (18:26 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 21 Jun 2011 17:26:39 +0000 (18:26 +0100)
commita53cb5b82d0490241ec48bd0083939823b6d39f9
tree92c484146f5c7d0c9c3ba435ecb579d380bb713e
parentdbf20f55f0c154d11153c40f2a709b8c32bb83cc
libxl: autogenerate to_string and from_string functions for Enumerations.

The generated strings are the lower case enum value names, with underscores.
Accepted string for parsing are the same but are case insensitive.

We provide a table of strings->value for each Enumeration as well as a
convenience function to perform a lookup.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
.hgignore
tools/libxl/Makefile
tools/libxl/gentest.py [new file with mode: 0644]
tools/libxl/gentypes.py
tools/libxl/libxl.h
tools/libxl/libxl_internal.h
tools/libxl/libxl_utils.c
tools/libxl/testenum.c [new file with mode: 0644]